home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Magazine / C_Tutorial / Part-13 / PatchLib / source / InstallPatch.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-01  |  1.8 KB  |  73 lines

  1. /*
  2. **    patch.library
  3. **
  4. **    Copyright © 1993-1997 by Stefan Fuchs
  5. **        Freely distributable.
  6. */
  7.  
  8. #ifndef _PATCH_INCLUDES_H
  9. #include "patch_includes.h"
  10. #endif
  11.  
  12.  
  13. /****** patch.library/InstallPatch ***************************************
  14. *
  15. *   NAME
  16. *        InstallPatch -- Installs a patchroutine for library functions.
  17. *
  18. *   SYNOPSIS
  19. *        patch = InstallPatch( newpatch )
  20. *        D0                    A0
  21. *
  22. *        struct Patch *InstallPatch( struct NewPatch * );
  23. *
  24. *   FUNCTION
  25. *        This function exists only for historic reasons. It will internally
  26. *        routed back to InstallPatchTags(). Because InstallPatchTags()
  27. *        has advanced features there is definitely no need to call this
  28. *        function at all.
  29. *
  30. *   INPUTS
  31. *        newpatch = pointer to an instance of a NewPatch structure
  32. *
  33. *   RESULT
  34. *        patch = pointer to a patch structure or NULL on failure
  35. *
  36. *   NOTES
  37. *
  38. *   BUGS
  39. *
  40. *   SEE ALSO
  41. *        InstallPatchTags(), patchobsolete.h
  42. *
  43. ******************************************************************************
  44. *
  45. */
  46.  
  47. struct Patch * LIBFUNC InstallPatch( REGA0 struct NewPatch *newpatch GNUC_REGA0)
  48. {
  49. struct TagItem taglist[7];
  50.  
  51.     taglist[0].ti_Tag = PATT_NewCodeSize;
  52.     taglist[0].ti_Data = newpatch->NPAT_NewCodeSize;
  53.  
  54.     taglist[1].ti_Tag = PATT_LibraryName;
  55.     taglist[1].ti_Data = (ULONG)newpatch->NPAT_LibraryName;
  56.  
  57.     taglist[2].ti_Tag = PATT_LibVersion;
  58.     taglist[2].ti_Data = newpatch->NPAT_LibVersion;
  59.  
  60.     taglist[3].ti_Tag = PATT_Priority;
  61.     taglist[3].ti_Data = newpatch->NPAT_Priority;
  62.  
  63.     taglist[4].ti_Tag = PATT_PatchName;
  64.     taglist[4].ti_Data = (ULONG)newpatch->NPAT_PatchName;
  65.  
  66.     taglist[5].ti_Tag = PATT_Result2;
  67.     taglist[5].ti_Data = (ULONG)newpatch->NPAT_Result2;
  68.  
  69.     taglist[6].ti_Tag = TAG_DONE;
  70.  
  71.     return(InstallPatchTagsA(newpatch->NPAT_NewCode, newpatch->NPAT_LVO, taglist));
  72. }
  73.